/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package CareerService.UserDAO;

import java.util.*;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author Administrator
 */
@Stateless
public class UserRegBean implements UserRegLocal {
     @PersistenceContext protected EntityManager em;
    public void register(String username, String password, String userrole){
        try{
            Query query=em.createQuery("select DISTINCT u from Users where u.username=:name");
            query.setParameter("name", username);
        
            List result =query.getResultList();
            Iterator iterator=result.iterator();

            if(iterator.hasNext()){
           
             }
            else{
                
            }
           }catch(Exception ex){
                ex.printStackTrace(); 
            }
    }
    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method" or "Web Service > Add Operation")
 
}
